#!/bin/bash

is_yes() {
        # Test syntax
        if [ $# = 0 ]; then
                msg_usage " is_yes {value}"
                return 2
        fi

        # Check value
        case "$1" in
        yes|Yes|YES|true|True|TRUE|on|On|ON|Y|y|1)
                # true returns zero
                return 0
                ;;
        *)
                # false returns one
                return 1
                ;;
        esac
}

is_no() {
        # Test syntax
        if [ $# = 0 ]; then
                msg_usage " is_no {value}"
                return 2
        fi

        case "$1" in
        no|No|NO|false|False|FALSE|off|Off|OFF|N|n|0)
                # true returns zero
                return 0
                ;;
        *)
                # false returns one
                return 1
                ;;
        esac
}


